﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Drawing;

namespace Chess
{
	public enum Team { Black, White };

	public abstract class Piece
	{
		// Piece properties
		public Team Color { get; protected set; }
		public Point Position{ get; protected set; }
		protected Piece[,] Board;
		protected int Direction;
		
		public List<Point> ValidAttacks, ValidMoves;

		// Piece constructor
		public Piece(Team _color, Point _position, ref Piece[,] _board)
		{
			Color = _color;
			Position = _position;
			Board = _board;

			Direction = (_color == Team.Black) ? 1 : -1;
			
			ValidAttacks = new List<Point>();
			ValidMoves = new List<Point>();
		}

		// Update valid moves and attacks
		public abstract void Refresh();

		// Update Position and Board
		public abstract void Move(Point _position);
	}
}
